//
//  BaseModel.m
//  New
//
//  Created by 才诗琦 on 16/1/16.
//  Copyright © 2016年 www.lanou3g.com. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel
- (instancetype)initWithDic:(NSDictionary *)dic

{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}
+ (instancetype)modelWithDic:(NSDictionary *)dic
{
    id m = [[[self class] alloc] initWithDic:dic];
    
    return m;
    
}

+(NSMutableArray *)modelHandlerWithArray:(NSArray *)arr
{
    NSMutableArray *tempArr = [NSMutableArray array];
    for (NSDictionary *dic in arr) {
        id m = [[self class] modelWithDic:dic];
        [tempArr addObject:m];
    }
    
    return tempArr;
}
@end
